package com.yidu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yidu.dao.ListenUserRoleMapper;
import com.yidu.domain.ListenUserRole;
import com.yidu.service.ListenUserRoleService;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author LiuXiang
 * @since 2018-11-27
 */
@Service
public class ListenUserRoleServiceImpl  implements ListenUserRoleService {

	@Resource
	private ListenUserRoleMapper roleMapper;
	/**
	 * 查询所有,分页
	 */
	@Override
	public PageInfo<ListenUserRole> findAll(Integer page, Integer pageSize, ListenUserRole role) {
		PageHelper.startPage(page, pageSize);
        List<ListenUserRole> store = roleMapper.findAll(role);
        PageInfo<ListenUserRole> storePageInfo = new PageInfo<>(store);
        return storePageInfo;
	}

	@Override
	public int insertSelective(ListenUserRole role) {
		return roleMapper.insertSelective(role);
	}

	@Override
	public int updateByPrimaryKeySelective(ListenUserRole role) {
		return roleMapper.updateByPrimaryKeySelective(role);
	}

	@Override
	public List<ListenUserRole> selectByPrimaryKey(String urId) {
		return roleMapper.selectByBuId(urId);
	}

	@Override
	public int deleteByPrimaryKey(String urId) {
		return roleMapper.deleteByPrimaryKey(urId);
	}
	
	@Override
	public List<ListenUserRole> selectRole(String urId) {
		return roleMapper.selectRole(urId);
	}

	@Override
	public ListenUserRole queryAll() {
		return roleMapper.queryAll();
	}

	@Override
	public int deleteByBuId(String buId) {
		return roleMapper.deleteByPrimaryKey(buId);
	}

}
